#!/usr/bin/python
# -*- coding: UTF-8 -*-
from urllib import request
url_openfile = "https://www.baidu.com"
f = request.urlopen(url_openfile)
data = f.read()
print(data)
f.close()

from urllib import parse
s="中文"
# 编码
result = parse.quote(s)
print(result)
# 解码
s1 = parse.unquote(result)
print(s1)